﻿// Copyright 2009 Mike Geise
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

namespace Falcon.Core.ViewModels
{
	using System;
	using System.Collections.Generic;
	using Falcon.Core.Domain;
	using Falcon.Core.Domain.Enums;
	using Falcon.Core.Extensions;

	public class UserPermissionViewModel
	{
		public UserPermissionViewModel()
		{
			this.ActionNames = Enum.GetNames(typeof(UserPermissionActions));
			this.ActionValues = Enum.GetValues(typeof(UserPermissionActions)).As<int[]>();
		}

		/// <summary>
		/// Gets or sets the user.
		/// </summary>
		/// <value>The user.</value>
		public User User
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the roles.
		/// </summary>
		/// <value>The roles.</value>
		public IList<UserRole> Roles
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the selected.
		/// </summary>
		/// <value>The selected.</value>
		public Dictionary<string, UserPermission> Permissions
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the action names.
		/// </summary>
		/// <value>The action names.</value>
		public string[] ActionNames
		{
			get;
			set;
		}

		/// <summary>
		/// Gets or sets the action values.
		/// </summary>
		/// <value>The action values.</value>
		public int[] ActionValues
		{
			get;
			set;
		}
	}
}